PHP ucfirst — Make a strings first character uppercase

254

PHP ucfirst — Make a string's first character uppercase -

<?php
$foo = 'hello world!';
$foo = ucfirst($foo);             // Hello world!

$bar = 'HELLO WORLD!';
$bar = ucfirst($bar);             // HELLO WORLD!
$bar = ucfirst(strtolower($bar)); // Hello world!
?>

Comments

Submit
0 Comments